//package com.codeest.geeknews.presenter.zhihu;
//
//import android.support.test.rule.ActivityTestRule;
//
//import com.codeest.geeknews.EspressoDaggerMockRule;
//import com.codeest.geeknews.ui.main.activity.MainActivity;
//
//import org.junit.Before;
//import org.junit.Rule;
//import org.junit.Test;
//
///**
// * Created by admin on 2017/7/6.
// */
//
//public class DailyPresenterTest {
//    private final static String TAG = "DailyPresenterTest";
//
//    @Rule
//    public EspressoDaggerMockRule rule = new EspressoDaggerMockRule();
//
//    @Rule
//    public ActivityTestRule<MainActivity> activityRule = new ActivityTestRule<>(MainActivity.class, false, false);
//
//
//    @Before
//    public void init() {
//    }
//
//    @Test
//    public void testOnCreate() {
////        final MainActivity activity = activityRule.launchActivity(null);
////        AppModule mockAppModule = mock(AppModule.class);
////        MainPresenter mockLoginPresenter = mock(MainPresenter.class);
////        //mockLoginPresenter.attachView(activity);
////        Mockito.when(mockAppModule.provideMainPresenter(any(DataManager.class))).thenReturn(mockLoginPresenter);  //当mockAppModule的provideMainPresenter()方法被调用时，让它返回mockLoginPresenter
////        AppComponent appComponent = DaggerAppComponent.builder().appModule(mockAppModule).build();  //用mockAppModule来创建DaggerAppComponent
////        ((App) activity.getApplication()).setComponent(appComponent);
////        try {
////            PackageManager pm = activity.getPackageManager();
////            PackageInfo pi = pm.getPackageInfo(activity.getPackageName(), PackageManager.GET_ACTIVITIES);
////            String versionName = pi.versionName;
////            verify(mockLoginPresenter).checkVersion(versionName);
////        } catch (PackageManager.NameNotFoundException e) {
////            e.printStackTrace();
////        }
//    }
//
//
//}
